﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="FimetContoDeposito.Authentication.login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Meta information -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"/>
<!-- Title-->
<title>FCD |  Admin HTML Themes</title>
<!-- Favicons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png"/>
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png"/>
<link rel="shortcut icon" href="assets/ico/favicon.ico"/>
<!-- CSS Stylesheet-->
<link type="text/css" rel="stylesheet" href="/assets/css/bootstrap/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="/assets/css/bootstrap/bootstrap-themes.css" />
<link type="text/css" rel="stylesheet" href="/assets/css/style.css" />

</head>
<body class="full-lg">
<div id="wrapper">

<div id="loading-top">
		<div id="canvas_loading"></div>
		<span style="color:white">Verifica in corso...</span>
</div>

<div id="main">
		<div class="container">
				<div class="row">
						<div class="col-lg-12">
						
								<div class="account-wall">
										<section class="align-lg-center">
										<div class="site-logo"></div>
										<h1 class="login-title">Benvenuti nella sezione Conto Deposito Clienti</h1>
										</section>
										<form id="form-signin" class="form-signin">
												<section>
														<div class="input-group">
																<div class="input-group-addon"><i class="fa fa-user"></i></div>
																<input  type="text" class="form-control" id="username" name="username" placeholder="Username"/>
														</div>
														<div class="input-group">
																<div class="input-group-addon"><i class="fa fa-key"></i></div>
																<input type="password" class="form-control" id="password" name="password" placeholder="Password"/>
														</div>
														<button class="btn btn-lg btn-theme-inverse btn-block" type="submit" id="sign-in">Sign in</button>
												</section>
												<section class="clearfix">
<%--														<div class="iCheck pull-left"  data-color="red">
														<input type="checkbox" checked="checked" />
														<label>Ricordami</label>
														</div>--%>
														<a href="#" class="pull-right help">Password dimenticata? </a>
												</section>		
												<span class="or" data-text="Or"></span>
												<button class="btn btn-lg  btn-inverse btn-block" id="new_account" type="button"> Nuovo account </button>
										</form>
										<a href="#" class="footer-link">&copy; 2016 Fimet s.r.l </a>
								</div>	
								<!-- //account-wall-->
								
						</div>
						<!-- //col-sm-6 col-md-4 col-md-offset-4-->
				</div>
				<!-- //row-->
		</div>
		<!-- //container-->
		
</div>
<!-- //main-->

		
</div>
<!-- //wrapper-->


<!--
////////////////////////////////////////////////////////////////////////
//////////     JAVASCRIPT  LIBRARY     //////////
/////////////////////////////////////////////////////////////////////
-->
		
<!-- Jquery Library -->
<script type="text/javascript" src="/Scripts/Bundles/JQuery/JQuery_1_11_3.js"></script>
<script type="text/javascript" src="/Scripts/Bundles/JQuery/jquery-ui.min_1_11_4.js"></script>
<script type="text/javascript" src="/assets/plugins/bootstrap/bootstrap.min.js"></script>
<!-- Modernizr Library For HTML5 And CSS3 -->
<script type="text/javascript" src="/assets/js/modernizr/modernizr.js"></script>
<script type="text/javascript" src="/assets/plugins/mmenu/jquery.mmenu.js"></script>
<script type="text/javascript" src="/assets/js/styleswitch.js"></script>
<!-- Library 10+ Form plugins-->
<script type="text/javascript" src="/assets/plugins/form/form.js"></script>
<!-- Datetime plugins -->
<script type="text/javascript" src="/assets/plugins/datetime/datetime.js"></script>
<!-- Library Chart-->
<script type="text/javascript" src="/assets/plugins/chart/chart.js"></script>
<!-- Library  5+ plugins for bootstrap -->
<script type="text/javascript" src="/assets/plugins/pluginsForBS/pluginsForBS.js"></script>
<!-- Library 10+ miscellaneous plugins -->
<script type="text/javascript" src="/assets/plugins/miscellaneous/miscellaneous.js"></script>
<!-- Library Themes Customize-->
<script type="text/javascript" src="/assets/js/caplet.custom.js"></script>
<script type="text/javascript">
    $(function () {
        //Login animation to center 
        function toCenter() {
            var mainH = $("#main").outerHeight();
            var accountH = $(".account-wall").outerHeight();
            var marginT = (mainH - accountH) / 2;
            if (marginT > 30) {
                $(".account-wall").css("margin-top", marginT - 15);
            } else {
                $(".account-wall").css("margin-top", 30);
            }
        }
        toCenter();
        var toResize;
        $(window).resize(function (e) {
            clearTimeout(toResize);
            toResize = setTimeout(toCenter(), 500);
        });

        //Canvas Loading
        var throbber = new Throbber({ size: 32, padding: 17, strokewidth: 2.8, lines: 12, rotationspeed: 0, fps: 15 });
        throbber.appendTo(document.getElementById('canvas_loading'));
        throbber.start();


        $("#form-signin").submit(function (event) {
            event.preventDefault();
            var main = $("#main");
            //scroll to top
            main.animate({
                scrollTop: 0
            }, 500);
            main.addClass("slideDown");

            var m_username = $('#username').val();
            var m_password = $('#password').val();
            var m_data = JSON.stringify({ username: m_username, password: m_password });

            // send username and password to php check login
            $.ajax({
                url: "/api/Authentication/CheckLogin",
                data: m_data,
                type: "POST",
                dataType: 'json',
                contentType: "application/json; charset=utf-8",
                success: function (e) {
                    setTimeout(function () { main.removeClass("slideDown") }, !e.Status ? 500 : 3000);

                    if (!e.Status) {
                        $.notific8('Check Username or Password again !! ', { life: 5000, horizontalEdge: "bottom", theme: "danger", heading: " ERROR :); " });
                        return false;
                    }

                    setTimeout(function () { $("#loading-top span").text("Account verificato...") }, 500);
                    setTimeout(function () { $("#loading-top span").text("Accesso al sito Fimet Conto Deposito...") }, 1500);
                    setTimeout("window.location.href='../Home.aspx'", 3100);

                }
            });

        });

        $("#new_account").click(function (e) {
            setTimeout("window.location.href='NewAccount.aspx'", 3100);
        });
    });
</script>
</body>
</html>
